import { CITY_INIT, CITY_UPDATE, CITY_CLEAR } from "../actionTypes";



const defaultState = {
  city: {

  }
}

export default (state = defaultState, action) => {
  if (action.type === CITY_INIT) {
    let newState = JSON.parse(JSON.stringify(state));
    newState.city = action.value;
    return newState
  } else if (action.type === CITY_UPDATE) {
    let newState = JSON.parse(JSON.stringify(state));
    newState.city = action.value;
    
    console.log("管理员中的打印",newState.city); 

    return newState
  } else if (action.type === CITY_CLEAR) {
    let newState = JSON.parse(JSON.stringify(state));
    newState.city = action.value;
    return newState
  }
  return state;
}